# -*- coding: utf-8 -*-
# 读写2003 excel
import xlrd
import re

workbook = xlrd.open_workbook("F:\\资源修改书单隐藏后.xls")
table=workbook.sheet_by_name('课程描述')
nrows=table.nrows
for i in range(nrows):
  csql="update resource_course set "
  row = table.row_values(i)
  if i<1:
    print("-- ----------课程描述-")
  else:
    j=0;
    resource_id ='';
    depict ='';
    feature ='';
    people_suitble ='';

    for cell in row:
      cell=str(cell).replace("\n", "").replace("\r","").replace("\u200B","").strip()
      if j==0:
        resource_id=cell
      if j==2:
        depict=cell
      if j==3:
        feature=cell
      if j==4:
        people_suitble=cell        
      j=j+1;
    if(len(resource_id)>0 and len(depict)>0  and len(feature)>0  and len(people_suitble)>0):
      print(csql +" `depict`= '"+depict+"',`feature`= '"+feature+"',`people_suitble`= '"+people_suitble+"' where `resource_id`= '" + resource_id  +"';")
  i=i+1

